package us.mooresr.webtroopmanager.client.place;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;

public class EditUserPlace extends Place {
	Long userId;
	
	
	public EditUserPlace(Long userId) {
		super();
		this.userId = userId;
	}


	public Long getUserId() {
		return userId;
	}


	public static class Tokenizer implements PlaceTokenizer<EditUserPlace> {

		@Override
		public EditUserPlace getPlace(String token) {
			if ((token == null) || (token.equals("null"))) {
				return null;
			} else {
				return new EditUserPlace(Long.parseLong(token));
			}
		}

		@Override
		public String getToken(EditUserPlace place) {
			if (place == null) {
				return "null";
			} else {
				if (place.getUserId() == null) {
					return "null";
				} else {
					return place.getUserId().toString();
				}
			}
		}
		
	}

}
